package com.gitee.vincentzyu.qwq_forge189.item;

import com.gitee.vincentzyu.qwq_forge189.QwqForge189;
import com.gitee.vincentzyu.qwq_forge189.inventory.GuiElementLoader;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import net.minecraft.stats.AchievementList;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;

public class QwqItem extends Item {
    public QwqItem(){
        super();
        this.setUnlocalizedName("qwqItem");
    }

    @Override
    public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) {
        if ( !worldIn.isRemote ){
            BlockPos pos = playerIn.getPosition();

            if ( playerIn.isSneaking() ){
                int id = GuiElementLoader.GUI_DEMO;
                playerIn.openGui(QwqForge189.instance, id, worldIn, pos.getX(), pos.getY(), pos.getZ());
            } else {
                int id2 = GuiElementLoader.ACHIEVEMENT_GUI;
                playerIn.openGui(QwqForge189.instance, id2, worldIn, pos.getX(), pos.getY(), pos.getZ());
            }


        }
        return itemStackIn;
    }
}
